package kr.hkit.powerjava.chapter11;

class Std extends Student{
	
}


public class Student {
	private int stuNum;
	private String stdName;
	
	public Student(int stuNum, String stdName) {
		this.stuNum = stuNum;
		this.stdName = stdName;
	}
	
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Student){
			return stuNum==((Student)obj).stuNum; 		//obj를 Student로 형변환
		}else{
			return false;
		}
	}


	public static void main(String[] args) {
		Student std01 = new Student(1, "김태희");
		Student std02 = new Student(1, "김태희");
		
		System.out.println(std01.equals(std02)?"true":"false");
	}
	
	
}
